
#import "scxg.h"


@implementation scxg

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
//cell赋值
-(void)setcellwithmodle:(id)model{
     HotModel  *readlistmodle =model;
    [self.picView sd_setImageWithURL:[NSURL URLWithString:readlistmodle.cover]];
    self.titlelab.text = readlistmodle.name;
//    self.introLab.text =readlistmodle.debugDescription;
}
 //视差效果
- (void)cellOnTableView:(UITableView *)tableView didScrollOnView:(UIView *)view
{
    [self layoutIfNeeded];
    self.picView.contentMode =  UIViewContentModeScaleAspectFill;
    CGRect rectInSuperview = [tableView convertRect:self.frame toView:view];
    
    float distanceFromCenter = CGRectGetHeight(view.frame)/2 - CGRectGetMinY(rectInSuperview);
    float difference = CGRectGetHeight(self.picView.frame) - CGRectGetHeight(self.frame);
    float move = (distanceFromCenter / CGRectGetHeight(view.frame)) * difference;
    
    CGRect imageRect = self.picView.frame;
    imageRect.origin.y = -(difference/2)+move;
    self.picView.frame = imageRect; //视差效果
}




@end
